import XEUtils from 'xe-utils'

export function createDefaultRender (defaultProps) {
  return function (h, renderOpts, params, context) {
    let { data, property } = params
    let { name } = renderOpts
    let { attrs } = renderOpts
    return [
      h("el-tag", {
        attrs,
        props
      })
    ]
  }
}

export function findDictName (arr,id,option={}) {

  if(Object.keys(option).length===0){
    option.label = 'label'
    option.value = 'value'
  }
  return arr.find(item =>{
    return item[option.value].toString() === id.toString()
  })
}
